<h1>Listing departments</h1>

<table>
  <tr>
    <th>Name</th>
    <th>Manager</th>
  </tr>

<% for department in @departments %>
  <tr>
    <td><%=h department.name %></td>
    <td><%=h department.manager_id %></td>
    <td><%= link_to 'Show', department %></td>
    <td><%= link_to 'Edit', edit_department_path(department) %></td>
    <td><%= link_to 'Destroy', department, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New department', new_department_path %>
